<template>
    <div>
        <p>{{getName}}</p>
        <button @click="add">{{getCount}}</button>
        <demo/>
    </div>
</template>

<script>
    import demo from './demo.vue';
    import { store,  mutation} from '@/common/store'
    export default {
        components:{
            demo,
        },
        data() {
            return {

            }
        },
        computed: {
            getCount(){
                return store.count;
            },
            getName(){
                return store.name;
            }
        },
        methods: {
            add(){
                let val = this.getCount;
                val++;
                mutation.setCount(val);
            }
        },
    }
</script>

<style lang="scss" scoped>

</style>
